<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2007 sp2 (http://www.altova.com) by Mathieu CARTOIXA (NourY Solutions) -->
<xs:schema xmlns="http://www.nourysolutions.com/salamanca/DML" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dml="http://www.nourysolutions.com/salamanca/DML" targetNamespace="http://www.nourysolutions.com/salamanca/DML" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="dml">
    <xs:annotation>
      <xs:documentation>Domain Modeling Language</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="serializable" maxOccurs="unbounded"/>
        <xs:element ref="type" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="enum" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element ref="domain" maxOccurs="unbounded"/>
        <xs:element ref="assoc" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
    <xs:unique name="typeName">
      <xs:selector xpath="dml:serializable | dml:type | dml:enum"/>
      <xs:field xpath="@name"/>
    </xs:unique>
    <xs:unique name="objectName">
      <xs:selector xpath="dml:domain | dml:enum | dml:assoc"/>
      <xs:field xpath="@name"/>
    </xs:unique>
    <xs:key name="baseTypes">
      <xs:selector xpath="dml:serializable"/>
      <xs:field xpath="@name"/>
    </xs:key>
    <xs:keyref name="typesBase" refer="dml:baseTypes">
      <xs:selector xpath="dml:type/dml:base | dml:enum/dml:base"/>
      <xs:field xpath="@name"/>
    </xs:keyref>
  </xs:element>
  <xs:element name="baseType" abstract="true"/>
  <xs:element name="serializable" substitutionGroup="baseType" final="#all">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="native"/>
        <xs:element name="sql">
          <xs:complexType>
            <xs:sequence minOccurs="0">
              <xs:element ref="conversion"/>
            </xs:sequence>
            <xs:attribute name="dbtype" use="required">
              <xs:simpleType>
                <xs:restriction base="xs:NMTOKEN">
                  <xs:enumeration value="ARRAY"/>
                  <xs:enumeration value="BIGINT">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">-9223372036854775808 to 9223372036854775807</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="BINARY">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">254 bytes</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="BIT">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">0, 1</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="BLOB"/>
                  <xs:enumeration value="BOOLEAN">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">true, false</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="CHAR">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">254 (8-bit characters)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="CLOB"/>
                  <xs:enumeration value="DATALINK"/>
                  <xs:enumeration value="DATE">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">year, month, day</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="DECIMAL">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">15 for precision (total number of digits) and for scale (number of digits after the decimal point)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="DISTINCT"/>
                  <xs:enumeration value="DOUBLE">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">15 bits of mantissa (fractional part)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="FLOAT">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">15 bits of mantissa (fractional part)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="INTEGER">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">-2147483648 to 2147483647</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="JAVA_OBJECT"/>
                  <xs:enumeration value="LONGVARBINARY">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">1 GB</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="LONGVARCHAR">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">1 GB (8-bit characters)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="NULL"/>
                  <xs:enumeration value="NUMERIC">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">15 for precision (total number of digits) and for scale (number of digits after the decimal point)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="OTHER"/>
                  <xs:enumeration value="REAL">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">7 bits of mantissa (fractional part)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="REF"/>
                  <xs:enumeration value="SMALLINT">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">-32768 to 32767</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="STRUCT"/>
                  <xs:enumeration value="TIME">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">hours, minutes, seconds</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="TIMESTAMP">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">year, month, day, hours, minutes, seconds, nanoseconds</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="TINYINT">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">-128 to 127 (8 bit signed) or 0 to 254 (8 bit unsigned)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="VARBINARY">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">254 bytes</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                  <xs:enumeration value="VARCHAR">
                    <xs:annotation>
                      <xs:documentation xml:lang="en">254 bytes (8-bit characters)</xs:documentation>
                    </xs:annotation>
                  </xs:enumeration>
                </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="size" type="xs:unsignedInt" use="optional"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attributeGroup ref="named"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="type" substitutionGroup="baseType">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="native"/>
        <xs:element ref="base"/>
      </xs:sequence>
      <xs:attributeGroup ref="named"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="enum" substitutionGroup="baseType">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="base"/>
        <xs:element name="value" maxOccurs="unbounded">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attributeGroup ref="named"/>
                <xs:attribute name="code" use="required">
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:whiteSpace value="collapse"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attributeGroup ref="identifiable"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="base">
    <xs:complexType>
      <xs:attribute name="name" type="xs:string" use="required"/>
      <xs:attribute name="size" type="xs:unsignedInt" use="optional"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="native">
    <xs:complexType>
      <xs:sequence minOccurs="0">
        <xs:element ref="conversion"/>
      </xs:sequence>
      <xs:attribute name="type" type="xs:string" use="required"/>
      <xs:attribute name="nullable" type="xs:boolean" default="true"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="conversion">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="xs:string">
          <xs:attribute name="language" use="required">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="C#"/>
                <xs:enumeration value="Java"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="domain">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="key" nillable="true" minOccurs="0">
          <xs:complexType>
            <xs:attribute name="attributes" type="xs:string" use="required"/>
            <xs:attribute name="generation" default="native">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:enumeration value="none"/>
                  <xs:enumeration value="native"/>
                  <xs:enumeration value="idbroker"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
        <xs:element name="index" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:attribute name="attributes" type="xs:string" use="required"/>
          </xs:complexType>
        </xs:element>
        <xs:element name="unique" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:attribute name="attributes" type="xs:string" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attributeGroup ref="identifiable"/>
      <xs:attribute name="extends">
        <xs:simpleType>
          <xs:restriction base="xs:Name">
            <xs:whiteSpace value="collapse"/>
            <xs:minLength value="1"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
    <xs:unique name="attributeName">
      <xs:selector xpath="dml:attribute"/>
      <xs:field xpath="@name"/>
    </xs:unique>
  </xs:element>
  <xs:element name="assoc">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="end" minOccurs="2" maxOccurs="2">
          <xs:complexType>
            <xs:attributeGroup ref="identifiable"/>
            <xs:attribute name="target" type="xs:string" use="required"/>
            <xs:attribute name="multiplicity" use="required">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:enumeration value="1"/>
                  <xs:enumeration value="*"/>
                  <xs:enumeration value="0..1"/>
                  <xs:enumeration value="1..*"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
            <xs:attributeGroup ref="visible"/>
          </xs:complexType>
        </xs:element>
        <xs:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attributeGroup ref="identifiable"/>
      <xs:attribute name="association" default="simple">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="simple"/>
            <xs:enumeration value="aggregation"/>
            <xs:enumeration value="composition"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:element name="attribute">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="type" nillable="true">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute name="name" type="xs:string" use="required"/>
                <xs:attribute name="size" type="xs:unsignedInt" use="optional"/>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attributeGroup ref="identifiable"/>
      <xs:attributeGroup ref="visible"/>
      <xs:attribute name="required" type="xs:boolean" default="false"/>
    </xs:complexType>
  </xs:element>
  <xs:attributeGroup name="identifiable">
    <xs:attribute name="name" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:Name">
          <xs:minLength value="1"/>
          <xs:whiteSpace value="collapse"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="shortName" use="optional">
      <xs:simpleType>
        <xs:restriction base="xs:Name">
          <xs:minLength value="1"/>
          <xs:maxLength value="24"/>
          <xs:whiteSpace value="collapse"/>
          <xs:pattern value="\w+"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="visible">
    <xs:attribute name="visibility" default="public">
      <xs:simpleType>
        <xs:restriction base="xs:NMTOKEN">
          <xs:enumeration value="none"/>
          <xs:enumeration value="internal"/>
          <xs:enumeration value="readonly"/>
          <xs:enumeration value="public"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
  <xs:attributeGroup name="named">
    <xs:attribute name="name" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:Name">
          <xs:minLength value="1"/>
          <xs:whiteSpace value="collapse"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>
</xs:schema>
